package org.rambadger.command.command;


import org.axonframework.commandhandling.annotation.TargetAggregateIdentifier;
import org.rambadger.command.validation.UrlIdentifier;

import javax.validation.constraints.NotNull;
import java.io.Serializable;

public abstract class AwardPoints {
    public static class AwardSubmissionPoints implements Serializable {
        private static final long serialVersionUID = 5287498803503588937L;
        @TargetAggregateIdentifier
        private final String username;
        private final int points;

        public AwardSubmissionPoints(String username, int points) {
            this.username = username;
            this.points = points;
        }

        @UrlIdentifier
        @NotNull
        public String getUsername() {
            return username;
        }

        //We may chose to let this be negative
        public int getPoints() {
            return points;
        }

        @Override
        public String toString() {
            return "AwardSubmissionPoints{" +
                    "username='" + username + '\'' +
                    ", points=" + points +
                    '}';
        }
    }


    public static class AwardReviewPoints implements Serializable {
        private static final long serialVersionUID = 8823804914241454873L;
        @TargetAggregateIdentifier
        private final String username;
        private final int points;

        public AwardReviewPoints(String username, int points) {
            this.username = username;
            this.points = points;
        }

        @UrlIdentifier @NotNull
        public String getUsername() {
            return username;
        }

        //We may chose to let this be negative
        public int getPoints() {
            return points;
        }

        @Override
        public String toString() {
            return "AwardReviewPoints{" +
                    "username='" + username + '\'' +
                    ", points=" + points +
                    '}';
        }
    }
}